var $ = require('../../common/helper.js');
Page({
	data: {
		member_id: 0,
		cart_total: 0,
		coupon_count: 0,
		not_pay: 0,
		not_shipping: 0,
		not_confirm: 0,
		not_comment: 0,
		notify: 0,
		member: null
	},
	onLoad: function (options) {
		var _this = this;
		$.get('api.php?app=member&act=index', function (json) {
			_this.setData({
				member_id: json.data.member_id,
				cart_total: json.data.cart_total,
				coupon_count: json.data.coupon_count,
				not_pay: json.data.not_pay,
				not_shipping: json.data.not_shipping,
				not_confirm: json.data.not_confirm,
				not_comment: json.data.not_comment,
				notify: json.data.notify,
				member: json.data.member
			});
			$.storage('person', json.data.member);
		});
	},
	onShareAppMessage: function (res) {
		if (res.from === 'button') {
			//来自页面内转发按钮
			//console.log(res.target)
		}
		return {
			title: $.config.shareTitle,
			imageUrl: $.config.shareImageUrl,
			path: this.route,
			success: function (res) {
				//转发成功
			},
			fail: function (res) {
				//转发失败
			},
			complete: function (res) {
				//转发结束
			}
		}
	}
})